<%@ Page Language="C#" %>
<%@ Import namespace="IFXplus.Northwind"%>
<%@ Import Namespace="System.Collections.Generic" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        List<Customer> cl = CustomerManager.GetCustomerList();
		CustomerListView.DataSource = cl;
		CustomerListView.DataBind();
    }
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Customer List</title>
</head>
<body>
    <div>
		<asp:Repeater id="CustomerListView" runat="server">
			<HeaderTemplate>
				<table border="1">
					<tr>
						<th>CustomerID</th>
						<th>ContactName</th>
						<th>CompanyName</th>
						<th>Country</th>
					</tr>
			</HeaderTemplate>
			<ItemTemplate>
				<tr>
					<td><a href="customerview.aspx?id=<%# ((Customer)Container.DataItem).CustomerId %>"><%# ((Customer)Container.DataItem).CustomerId %></a></td>
					<td><%# ((Customer)Container.DataItem).ContactName %></td>
					<td><%# ((Customer)Container.DataItem).CompanyName %></td>
					<td><%# ((Customer)Container.DataItem).Country %></td>
				</tr>
			</ItemTemplate>
			<FooterTemplate>
				</table>
			</FooterTemplate>
		</asp:Repeater>
		<hr />
		<a href="customercreate.aspx">Nuovo...</a>
    </div>
</body>
</html>
